package jee.boot.module.file.attachment.rest;

import jee.boot.common.basic.CrudController;
import jee.boot.common.basic.result.ResponseMessage;
import jee.boot.common.basic.result.Result;
import jee.boot.entity.file.AttachmentMapping;
import jee.boot.module.file.attachment.service.AttachmentMappingService;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 附件Controller
 * 
 * @author zhilei.wang
 * @version 2018-01-25
 */
@RestController
@RequestMapping(value = "/attachment/mapping")
public class AttachmentMappingRestController extends CrudController<AttachmentMappingService, AttachmentMapping> {
    /**
     * 批量删除
     *
     * @param entity
     * @return
     */
    @PostMapping("/deleteByBusinessId")
    public ResponseMessage<Object> deleteByBusinessId(@RequestBody AttachmentMapping entity) {
        service.deleteByBusinessId(entity);
        return Result.success();
    }
}